home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include "aspi.h"
- #include "scsidefs.h"
-
- static char *astatus[] = { "Play", "Pause", "Ready", "Stop" };
-
- main()
- {
- int t, h, l, id, nh;
- nh = aspi_init();
- if (nh < 1)
- return 1;
- for (h=0; h<nh; h++)
- for (t=0; t<8; t++)
- for (l=0; l<8; l++)
- {
- int type;
- id = ASPI_MKID(h,t,l);
- type = aspi_device_type(id);
- if (type != -1)
- {
- unsigned char cdb[12];
- char buf[96];
- printf("scsi(%d,%d,%d) = 0x%02x",
- ASPI_ID2HOSTAD(id),
- ASPI_ID2TARGET(id),
- ASPI_ID2LUN(id),
- type);
-
- cdb[0] = 0x12;
- cdb[1] = l << 5;
- cdb[2] = 0x00;
- cdb[3] = 0x00;
- cdb[4] = 96;
- cdb[5] = 0x00;
- aspi_exec(id, buf, 96, ASPI_RW_READ, cdb, 6);
- printf(" - %.8s %.16s %.4s %.8s %.12s\n",
- buf+8, buf+16, buf+32, buf+36, buf+44);
-
- if (type == DTYPE_CROM)
- {
- int old_t = -1;
- while (!kbhit())
- {
- memset(cdb, 0, 10);
- cdb[0] = 0xc6;
- cdb[1] = 10 | (l<<5);
- aspi_exec(id, buf, 10, ASPI_RW_READ, cdb, 10);
- if (buf[6] != old_t)
- printf(" %02x %02x:%02x:%02x %02x:%02x:%02x %s\r",
- buf[2], buf[4], buf[5], buf[6], buf[7], buf[8], buf[9], astatus[buf[0]]);
- old_t = buf[6];
- fflush(stdout);
- if (buf[0])
- break;
- }
- if (kbhit())
- getkey();
- }
- }
- }
- aspi_close();
- return 0;
- }
-